export function findMenu(menuList, index) {
  for (let i = 0; i < menuList.length; i++) {
    const menu = menuList[i]
    if (menu.index === index) {
      return menu
    } else {
      if (menu?.children?.length) {
        const findItem = findMenu(menu.children, index)
        if (findItem) {
          return findItem
        }
      }
    }
  }
  return null
}
